import React from "react"
import ReactDom from "react-dom"

class Portal extends React.Component{
    constructor(){
        super()
        this.can=document.createElement("div")
        this.can.id="can"    
    }
    componentDidMount(){
        document.body.appendChild(this.can)
    }
    render(){
        let el=(
            <fieldset>
                <legend>传送门</legend>
                <h1>我要飞走了</h1>
            </fieldset>
        )
        return ReactDom.createPortal(el,this.can)
        // return el
        
    }
}
export default Portal